<template>
	<view class="page">
		<view class="page__list">
			<Item :meet_id="meet_id" :init="init" :info="item":type_sigin="type_sigin"  v-for="item in list" :key="item.id" />
		</view>
		<view class="page__canvas">
			<Canvas :meet_id="meet_id" :type_sigin="type_sigin" ref="canvas"/>
		</view>
		<view class="page__btn" @click="upload">
			确定
		</view>
	</view>
</template>

<script>
	import {
		meetSignatureList
	} from "@/api/autograph.js"
	export default {
		components: {
			Item: () => import("./compoents/Item.vue"),
			Canvas: () => import("./compoents/Canvas.vue")
		},
		onLoad(e){
			console.log(e);
			this.meet_id=e.meet_id
      this.type_sigin = e.type_sigin?e.type_sigin:'2'
		},
		mounted() {
			this.init();
		},
		data() {
			return {
				list: [],
				meet_id:"",
        type_sigin:""//判断 2 是手写签到页面   1是从扫码签到页面跳转过来的
			};
		},
		methods: {
			async init() {
				meetSignatureList().then(res => {
					// console.log(res,"res")
					this.list = res.data;
				})
			},
			async upload(){
			  const  res= await	this.$refs.canvas.saveImgInfo();
			  if(res.success){
					this.init()
			  }
			}
		}
	}
</script>

<style scoped lang="less">
	.page {
		box-sizing: border-box;
		padding: 30rpx;
		padding-bottom: 130rpx;

		&__list {
			display: flex;
			margin-bottom: 298rpx;
		}

		&__canvas {

		}

		&__btn {
			position: fixed;
			bottom: 30rpx;
			left: 50%;
			transform: translate(-50%, 0);
			// margin-top: 156rpx;
			width: 690rpx;
			font-size: 28rpx;
			font-family: PingFang SC-Medium, PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
			height: 80rpx;
			line-height: 80rpx;
			text-align: center;
			background: #4871C0;
			border-radius: 8rpx 8rpx 8rpx 8rpx;
			opacity: 1;
		}
	}
</style>
